'use strict';

/**
 * 陌生人记录schema
 */
const Cons = require('../common/constants');
const mongoose = require('mongoose'), Schema = mongoose.Schema;

const strangerRecordsSchema = new Schema({
    _id: { type: String }, //记录ID
    r_at: { type: Date, required: true }, //时间点
    r_cp: { type: String }, //抓拍人脸
    d_id: { type: String }, //设备id，用来区别门禁设备
    b_qp: { type: Array }, //抓拍图
    c_id: { type: String }, //创建者
    m_id: { type: String }, //更新者
    liveness: { type: Number, default: Cons.RECORD_LIVENESS_NOT_CHECK },  //-1 not check, 0 not liveness, 1 liveness

    // 补充巨龙参数
    d_uuid: {type: String},//uuid
    s_sex: {type:Number}, //识别的性别
    c_photo_name: {type: String}, //抓拍图片名称

    // 抓拍设备所在教室信息
    group_name:{type: String},//集团名称
    campus_name:{type: String},//校区名称
    class_name:{type: String},//班级名称
    classroom_id:{type: String},//教室id
    classroom_name:{type: String},//教室名称
    classroom_num:{type: String},//教室编号
}, { timestamps: { createdAt: 'c_at', updatedAt: 'm_at' } });

module.exports = mongoose.model('StrangerRecordsModel', strangerRecordsSchema, "record_stranger");
